﻿using System;
using HslCommunication.Core;

namespace HslCommunication.BasicFramework
{
	/// <summary>
	/// 内存队列的基类
	/// </summary>
	// Token: 0x0200018F RID: 399
	public abstract class SoftCacheArrayBase
	{
		/// <summary>
		/// 数据的长度
		/// </summary>
		// Token: 0x170006AA RID: 1706
		// (get) Token: 0x060020AC RID: 8364 RVA: 0x0009F2C4 File Offset: 0x0009D4C4
		// (set) Token: 0x060020AD RID: 8365 RVA: 0x0009F2CC File Offset: 0x0009D4CC
		public int ArrayLength { get; protected set; }

		/// <summary>
		/// 用于从保存的数据对象初始化的
		/// </summary>
		/// <param name="dataSave"></param>
		/// <exception cref="T:System.NullReferenceException"></exception>
		// Token: 0x060020AE RID: 8366 RVA: 0x00009AA1 File Offset: 0x00007CA1
		public virtual void LoadFromBytes(byte[] dataSave)
		{
		}

		/// <summary>
		/// 获取原本的数据字节
		/// </summary>
		/// <returns>字节数组</returns>
		// Token: 0x060020AF RID: 8367 RVA: 0x0009F2D8 File Offset: 0x0009D4D8
		public byte[] GetAllData()
		{
			byte[] array = new byte[this.DataBytes.Length];
			this.DataBytes.CopyTo(array, 0);
			return array;
		}

		/// <summary>
		/// 字节数据流
		/// </summary>
		// Token: 0x040007B8 RID: 1976
		protected byte[] DataBytes = null;

		/// <summary>
		/// 数据数组变动时的数据锁
		/// </summary>
		// Token: 0x040007BA RID: 1978
		protected SimpleHybirdLock HybirdLock = new SimpleHybirdLock();
	}
}
